home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / rand.man < prev    next >
Encoding:
Text File  |  1989-04-07  |  1.0 KB  |  67 lines

  1.  
  2.  
  3.  
  4. RAND                  C Library Procedures                   RAND
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      rand, srand - random number generator
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ssrraanndd((sseeeedd))
  13.      iinntt sseeeedd;;
  14.  
  15.      rraanndd(())
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      TThhee nneewweerr rraannddoomm((33)) sshhoouulldd bbee uusseedd iinn nneeww aapppplliiccaattiioonnss;; rraanndd
  19.      rreemmaaiinnss ffoorr ccoommppaattiibbiillttyy..
  20.  
  21.      _R_a_n_d uses a multiplicative congruential random number gen-
  22.      erator with period 2**32 to return successive pseudo-random
  23.      numbers in the range from 0 to (2**31)-1
  24.  
  25.      The generator is reinitialized by calling _s_r_a_n_d with 1 as
  26.      argument.  It can be set to a random starting point by cal-
  27.      ling _s_r_a_n_d with whatever you like as argument.
  28.  
  29. SSEEEE AALLSSOO
  30.      random(3)
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0            September 29, 1985                       1
  64.  
  65.  
  66.  
  67.